<?php
require_once('db/dba.php');
db_connect();

include "db/db_con.php";
$data=$_POST["data2"];





  $insert= "INSERT INTO traveltrain (coustomer,email,phone,trip_type,fromdata,todata,returndate,depart,infants,adults,children)  VALUES ('".$data["coustomerH"]."','".$data["emailH"]."','".$data['phoneH']."','".$data['trip_type_hotel']."','".$data['fromH']."','".$data['toH']."','".$data['returndateHotel']."','".$data["departHotel"]."','".$data["infantsH"]."','".$data["adultsH"]."','".$data["childrenH"]."')";
query($insert); 
echo  "<font color='green'>You request #". mysql_insert_id()." is sent to vendor</font>";


$subject="Request Id#".mysql_insert_id();


$message="
<p>Dear  ".$data['coustomerH'].", </p>
<p>This is to your Train booking request. Below are the details. </p>
<p>Request Number: ".mysql_insert_id()."</p>
<p>Status: Open</p>


<p>Train Booking details:</p>
<p>Customer Name:  ".$data['coustomerH']."</p>
<p>Email:  ".$data['emailH']."</p>
<p>Phone: ".$data['phoneH']."</p>";


if($data['departHotel']=="OneWayH")
{
$message.="<p>Depart: One Way </p>";
}

else
$message.="<p>Depart: Round Trip </p>";

$message.="
<p>From: $data[fromH]</p>
<p>To: ".$data['toH']."</p>
<p>Depart: ".$data['departHotel']."</p>
";

if($data['returndateHotel']!="")
{
$message .="<p>Return Date:  ".$data['returndateHotel']."</p>";
}


$message.="
<p>Adults:  ".$data['adultsH']."</p>
<p>Children:  ".$data['childrenH']."</p>
<p>Infants:  ".$data['infantsH']."</p>

<p>Connect to us:</p>
<p>We would like to hear from you.</p>
<p>For any questions, suggestions or comments please contact us at:</p>
<p>Warm regards,</p>

<p>Manish TalwarShree Communications</p>
";
/*
$message="<p>Thank You For Information</p>";


$message .="<p>Customer Name:  ".$data['coustomerH']."</p>";
$message .="<p>Email:  ".$data['emailH']."</p>";
$message .="<p>Phone:  ".$data['phoneH']."</p>";
$message .="<p>Trip Type:  ".$data['trip_type_hotel']."</p>";
$message .="<p>From:  ".$data['fromH']."</p>";
$message .="<p>To:  ".$data['toH']."</p>";
$message .="<p>Depart:  ".$data['departHotel']."</p>";
if($data['returndateHotel']!="")
{
$message .="<p>Return Date:  ".$data['returndateHotel']."</p>";
}

$message .="<p>Infants:  ".$data['infantsH']."</p>";
$message .="<p>Adults:  ".$data['adultsH']."</p>";
$message .="<p>Children:  ".$data['childrenH']."</p>";
*/

$headers= "Content-type: text/html\r\n"; 


mail($data["emailH"], $subject, $message, $headers);
mail('mail@firstnorthglobal.com', $subject, $message, $headers);
//mail('mar111ia@yahoo.com', $subject, $message, $headers);

//mail('mar111ia@yahoo.com', $subject, $message, $headers);



?>